<template>
  <div>
    <MyOrder v-for="item, index in orderList" :key="index" :orderInfo="item" @myCancelOrder="cancelOrder"></MyOrder>
  </div>
</template>

<script>
import MyOrder from "@/components/MyOrder"
export default {
    name:'AllOrder',
    props: ['orderList'],
    components:{
        MyOrder
    },
    methods:{
      // 取消订单
      async cancelOrder(id){
        let res = await this.$store.dispatch("cancelOrder", id)
        if(res.success){
          this.$toast.success(res.message)
          this.$emit("refreshData")
        }
        else this.$myFun.resError(res.message)
      }
    }
}
</script>

<style>

</style>